package com.trkj.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;

import com.trkj.pojo.Emp;
import com.trkj.service.ReloanService;
import com.trkj.vo.ReloanVo;

@Controller
@SessionAttributes({"emp", "funcIds"})
public class ReloanController {
	@Autowired
	ReloanService reloanService;
	
	
	@RequestMapping("/getReloanEmpInfo")
	@ResponseBody
	public ReloanVo getReloanEmpInfo(Model model) {
		Integer empId = getOnLineEmp(model);
		if (empId!=null) {
			return reloanService.getReloanEmpInfo(empId);
		}
		return null;
	}
	/**
	 * 获取登录人的id
	 * @author Lixd
	 * @param model
	 * @return
	 */
	private Integer getOnLineEmp(Model model) {
		Emp emp = (Emp)model.asMap().get("emp");
		Integer useid = emp.getEmpId();
		return useid;
	}
}
